<form id="foot-frm" method="post">
  <table class="gritter-with-table form-table"  cellspacing="1">	
      <tr>
  			<th ><font color="red">*</font>起点：</th>
  			<td>
  				<input name="startPoint" id="startPoint" style="width:60%;" type="text" datatype="*1-255" nullmsg="请填写" sucmsg=" " />
         	<div class="Validform_checktip"></div>             	
        </td>
        <th ><font color="red">*</font>终点：</th>
        <td>
          <input name="endPoint" id="endPoint" style="width:60%;"  type="text" datatype="*1-255" nullmsg="请填写" sucmsg=" " class="span3" />
          <div class="Validform_checktip"></div>              
         </td>
      </tr>
      <tr>
        <th><font color="red">*</font>时间：</th>
        <td>
          <div class="input-group" style="width:60%;">
            <input type="text" id="time" name="footTime" readonly>
            <span class="input-group-addon" id="time-icon" style="cursor: pointer;"><i class="fa fa-calendar"></i></span>
            <div class="Validform_checktip"></div>    
        </div>          
        </td>
        <th ><font color="red">*</font>天气：</th>
        <td>
          <input name="weather" id="weather" style="width:60%;"  type="text" datatype="*1-255" nullmsg="请填写" sucmsg=" " class="span3" />
          <div class="Validform_checktip"></div>              
         </td>
      </tr>
      <tr>
        <th><font color="red">*</font>心情：</th>
        <td colspan="3">
          <input name="heart" id="heart" style="width:60%;" type="text" datatype="*1-255" nullmsg="请填写" sucmsg=" " />
          <div class="Validform_checktip"></div>              
        </td>
      </tr>
      <tr>
        <th ><font color="red">*</font>感悟：</th>
        <td colspan="3">
          <textarea name="mind" id="" rows="4"></textarea>             
         </td>
      </tr>
  		            
  </table>
</form>
<script type="text/javascript">
(function(){
  $('#time').datepicker({
      format: 'yyyy-mm-dd',
      pickerPosition: "bottom-left"
  });
  $("#time-icon").click(function(){
    $('#time').focus();
  });
})();
var vl_frm = Power.form.validate("foot-frm","foot-add");
function submit(){
	if(vl_frm.check()){
		 	var cmd = new Power.submit("foot-frm","/demo/foot");
		 	var ret = cmd.execute("insert");
    	if(!ret.error&&ret.state==1){
    		Power.dialog.alertSuccess("添加成功!");
    		$.dialog.list["foot-add-dialog"].close();
    		return true;
    	}else{
    		Power.dialog.alertError("添加失败!");
    		return false;
    	}
	}
}

</script>
